package com.example.mybatisplusdemo.controller;


import com.example.mybatisplusdemo.entity.TestUser;
import com.example.mybatisplusdemo.service.ITestUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenjl
 * @since 2022-06-24
 */
@RestController
@RequestMapping("/test-user")
public class TestUserController {

    @Autowired
    ITestUserService testUserService;

    @GetMapping("/list")
    public List<TestUser> list(){
        return testUserService.list();
    }

    @GetMapping("select-one-by-username")
    public TestUser selectOneByUsername(String username){
        return testUserService.selectOneByUsername(username);
    }

}
